package com.yingli.network.task;

import android.os.AsyncTask;
import android.util.Log;

public class NetworkTask extends AsyncTask<String,Integer,String> {

    //在执行任务之前的操作
    @Override
    protected void onPreExecute() {
        super.onPreExecute();
    }

    @Override
    protected void onProgressUpdate(Integer... values) {
        super.onProgressUpdate(values);
    }

    //在后台执行（子线程中执行）
    @Override
    protected String doInBackground(String... strings) {
        StringBuilder builder = new StringBuilder();
        for (int i = 0; i < strings.length; i++) {
            builder.append(strings[i]);
        }
        Log.i("requestParams",builder.toString());
        return "success";
    }

    //在doInBackground方法之后，把操作的结果数据返回给此方法
    @Override
    protected void onPostExecute(String params) {
        super.onPostExecute(params);
        Log.i("postParams",params);

    }
}
